Full source code giải đố hình đơn giản
16.643 lượt xem;
- HelpController.cs
- Puzzle Menu Controller Scripts /
- Scripts /
- Assets /
- project /
1 using System.Collections;
2 using System.Collections.Generic;
3 using UnityEngine;
4
5 public class HelpController : MonoBehaviour {
6
7
8 [SerializeField]
9 private GameObject helpPanel;
10
11 [SerializeField]
12 private Animator helpPanelAnim;
13
14
15
16 public void OpenHelpPanel()
17 {
18
19 helpPanel.SetActive(true);
20 helpPanelAnim.Play("FadeIn");
21 }
22
23
24 public void CloseHelpPanel()
25 {
26 StartCoroutine(CloseHelp());
27 }
28
29 IEnumerator CloseHelp()
30 {
31 helpPanelAnim.Play("FadeOut");
32 yield return new WaitForSeconds(1f);
33 helpPanel.SetActive(false);
34 }
35
36
37 }
2 using System.Collections.Generic;
3 using UnityEngine;
4
5 public class HelpController : MonoBehaviour {
6
7
8 [SerializeField]
9 private GameObject helpPanel;
10
11 [SerializeField]
12 private Animator helpPanelAnim;
13
14
15
16 public void OpenHelpPanel()
17 {
18
19 helpPanel.SetActive(true);
20 helpPanelAnim.Play("FadeIn");
21 }
22
23
24 public void CloseHelpPanel()
25 {
26 StartCoroutine(CloseHelp());
27 }
28
29 IEnumerator CloseHelp()
30 {
31 helpPanelAnim.Play("FadeOut");
32 yield return new WaitForSeconds(1f);
33 helpPanel.SetActive(false);
34 }
35
36
37 }